Week OverviewMon – Fri · 10 hours total
Automation, version control, storage and process/service management — condensed into one week
This is the busiest week of the course. It combines what used to be two separate weeks — Bash scripting with Git, and storage with process/service management — into a single, tightly-paced week, so the course now finishes in seven weeks instead of eight. Every topic from both source weeks is still taught; the guided lab time for each has been trimmed to its most essential, representative exercises, and a handful of secondary/optional exercises have been moved to take-home practice (flagged in each day's lesson plan). Students write real Bash scripts, put them under Git version control, then shift into system administration — attaching and partitioning storage, and controlling processes and services with systemd. By Friday every student has a GitHub repository with committed and merged work, a persistent custom disk mount, and a systemd service they wrote themselves.
Week at a glance
Monday
Scripting: Variables, Conditionals, Loops & Functions
shebang, variables, read, if/elif/else, for/while, functions — the complete core of Bash scripting in one day
Tuesday
Error Handling, Debugging & Git
set -euo pipefail, guard clauses, bash -x/-n, then git init/add/commit/branch/merge, GitHub push
Wednesday
Storage: Mounts, fstab & Disk Management
reading fstab and UUIDs, then fdisk, mkfs, partprobe — add a virtual disk and persist it
Thursday
Processes & systemd
top, ps, signals, background jobs, then systemctl, journalctl, and a custom service unit
Friday
Mini-Assessment 5
Written: scripting, git, storage, processes, systemd. Practical: script+Git, disk, process+service tasks.
⭐ OverTheWire BanditStanding challenge — not assessed
Week 5 target: Levels 15–22
This week's target range is wider than usual (it absorbs both former Week 5 and Week 6 ranges) since it's self-paced stretch work, not graded. Level 15 uses SSL/TLS with openssl s_client. Level 16 scans ports with nmap. Level 17 compares files with diff. Level 18 runs a command non-interactively over SSH — echoing this week's scripting work. Level 19 introduces setuid binaries, connecting to Week 2's SUID content. Levels 20–22 involve a listening service, reading cron jobs in /etc/cron.d, and understanding a cron script — reinforcing Week 4 cron and this week's service content.
Learning OutcomesBy end of Week 5, students can…
Write Bash scriptsVariables, conditionals, loops, and functions — accepting user input and command-line arguments
Script defensivelyUse set -euo pipefail, guard clauses, and bash -x/-n to write and debug reliable scripts
Use Git and GitHubInit, stage, commit, branch, merge, and push a repository; collaborate on a shared repo
Mount and persist storageRead /etc/fstab, partition and format a disk with fdisk/mkfs, and mount it permanently via UUID
Inspect and control processesUse top and ps, manage background jobs, and send SIGTERM/SIGKILL correctly
Manage services with systemdUse systemctl and journalctl, and write a working custom service unit file
MondayLecture + Lab 5A · 2 hrs
Bash scripting fundamentals — variables, conditionals, loops, and functions in one day
0:00–0:10
Recap
0:10–0:45
Lecture
0:45–1:50
Lab 5A
1:50–2:00
Debrief
- Lecture (35 min): shebang, variables and command substitution, echo and read, numeric/string/file conditional tests, for and while loops, functions with local variables and $1/$2 arguments. This is everything from the former Monday and Tuesday of Bash scripting week, taught as one connected story rather than two separate lectures — deliberately brisk, since the lab reinforces each piece immediately.
- Lab 5A (65 min): greet.sh (variables, read, command substitution), number_check.sh and file_check.sh (conditionals), countdown.sh (for loop), and a trimmed disk_report.sh (functions with print_header). Four short scripts covering all four concepts — deeper practice scripts (args.sh, grade.sh, menu.sh, validate.sh) are provided as optional take-home extensions on the handout for students who finish early or want more reps.
Instructor note: This day used to be two separate days (variables/conditionals, then loops/functions). Watch the clock closely on the lecture — if it runs past 45 minutes, cut the functions section shorter and let disk_report.sh's reference table do more of the teaching.
TuesdayLecture + Lab 5B · 2 hrs
Error handling and debugging, then Git and GitHub
0:00–0:10
Recap
0:10–0:40
Lecture
0:40–1:50
Lab 5B
1:50–2:00
Debrief
- Lecture (30 min): set -euo pipefail, guard clauses, logging with tee -a, bash -x vs. bash -n — then straight into Git: init/add/commit, the feature-branch workflow, merging, and pushing to GitHub. Two originally separate lectures, tightened into one connected session: "scripts that fail safely, then put under version control."
- Lab 5B (70 min): safe_backup.sh (guard clauses), then bash -x on a provided buggy script to find and fix a logical error. Then: create the week5_scripts repository, add this week's scripts, make one feature-branch commit and merge it, and push to GitHub, finishing with the instructor-collaboration repo. The deliberate merge-conflict simulation from the original lab is kept on the handout as an optional take-home exercise — valuable, but too time-expensive for today's slot.
Time is tight today: this is the most compressed day of the week. If a student is still debugging buggy.sh past the 20-minute mark, have them move on to the Git section and return to the fix afterward — the Git workflow is the harder skill to recover if time runs out.
WednesdayLecture + Lab 5C · 2 hrs
Storage — reading fstab, then partitioning, formatting, and mounting a disk permanently
0:00–0:10
Recap
0:10–0:45
Lecture
0:45–1:50
Lab 5C
1:50–2:00
Debrief
- Lecture (35 min): the Linux storage model (no drive letters — everything mounts to a directory), the six fstab fields, why UUID beats device names, then the complete add-a-disk workflow: fdisk to partition, partprobe to inform the kernel, mkfs.ext4 to format, mount, and a persistent fstab entry tested with mount -a.
- Lab 5C (65 min): read and decode the existing /etc/fstab and blkid output (10 min), then the full hands-on build: attach a 5GB VHDX, partition it with fdisk, partprobe, format ext4, mount at ~/newpart, and add a working fstab entry using UUID, verified with mount -a (55 min). The ISO-mount and tmpfs demonstrations and the second-partition repeat from the original two-day version are on the handout as optional reference/take-home — one clean partition built start to finish is the priority today.
fdisk is destructive: as always, confirm with students that they are working on /dev/sdb (the new disk), never /dev/sda (the OS disk), before running any fdisk command.
ThursdayLecture + Lab 5D · 2 hrs
Processes — inspection and signals, then systemd services
0:00–0:10
Recap
0:10–0:45
Lecture
0:45–1:45
Lab 5D
1:45–1:55
Bonus
1:55–2:00
Wrap
- Lecture (35 min): what a process and a PID are, top and ps -ef, SIGTERM vs. SIGKILL, background jobs with Ctrl+Z/jobs/fg/bg — then systemd as PID 1, units, systemctl start/stop/enable/disable, journalctl, and the anatomy of a service unit file ([Unit]/[Service]/[Install]).
- Lab 5D (60 min): explore top and ps -ef (15 min); suspend and manage background jobs with Ctrl+Z, jobs, fg — then send SIGTERM and SIGKILL to a sleep process and confirm the difference (20 min); check, stop, start, disable, and re-enable the ssh service, then read its journal (10 min); write and install a custom heartbeat-style service unit, daemon-reload, enable --now, and verify with systemctl status and journalctl (15 min). Zombie-process research from the original lab is on the handout as an optional take-home question.
- Bonus (10 min): systemd-analyze blame — which services are slowest to start at boot, and why that matters.
The service-unit moment: students writing and enabling their own systemd service — the same skill the Friday practical will test — is the payoff of the week. Make sure every student reaches this before 1:45.
FridayMini-Assessment 5 · 2 hrs
Mini-Assessment 5 — Scripting, Git & System Administration
0:00–0:25
Written
0:25–1:50
Practical
1:50–2:00
Review
- Written (25 min, 30%): short-answer questions spanning all five days — variables/conditionals/loops/functions, git concepts, fstab fields and UUID, process signals, and systemctl/journalctl. See the Assessment 5 Written handout for the full question set.
- Practical (85 min, 70%): Task 1 — write a script from a specification, then init a Git repo, commit, branch, merge, and push it to GitHub (25 marks). Task 2 — partition, format, and mount a disk with a persistent fstab entry (25 marks). Task 3 — investigate running processes and build a working custom systemd service (20 marks).
| Topic | Weight | Format |
| Scripting logic (variables, conditionals, loops, functions) | 10% | Written |
| Git concepts | 5% | Written |
| fstab / UUID / storage theory | 5% | Written |
| Processes and systemd theory | 10% | Written |
| Script + Git workflow task | 25% | Practical |
| Storage task (partition, format, mount, fstab) | 25% | Practical |
| Process + custom systemd service task | 20% | Practical |
What you need ready before Monday
Lab 5A–5D handouts printed
git installed on VMs (apt install git)
Instructor GitHub repo prepared for Tuesday's collaboration task
5GB VHDX pre-created if possible for Wednesday
Mini-Assessment 5 printed (Friday)